package com.jzo2o.customer.controller.open;

import com.jzo2o.customer.model.dto.request.InstitutionRegisterReqDTO;
import com.jzo2o.customer.service.IServeProviderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController("openRegisterController")
@RequestMapping("/open/serve-provider")
@Api("注册")
public class RegisterController {

    @Resource
    private IServeProviderService iServeProviderService;

    @PostMapping("/institution/register")
    @ApiOperation("机构端注册接口")
    public void register(@RequestBody @ApiParam(name = "institutionRegisterReqDTO", value = "注册信息")
                             InstitutionRegisterReqDTO dto) {
        iServeProviderService.add(dto.getPhone(), dto.getPassword(), dto.getVerifyCode());
    }
}
